package com.hl.controller;


import com.hl.domain.Usermark;
import com.hl.service.serviceImpl.UsermarkServiceimpl;
import com.hl.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController

@RequestMapping("/usermark")
public class UsermarkContorller {
    @Autowired
    private UsermarkServiceimpl usermarkServiceimpl;

    @GetMapping("/select1")
    public R findAllid(Long id){
        return R.success(usermarkServiceimpl.selectByPrimaryKey(id));
    }

    @GetMapping("/select")
    public R findAll(){
        return R.success(usermarkServiceimpl.findAll());
    }

    @PostMapping("/add")
    public R add(Usermark record){
        return R.success(usermarkServiceimpl.insert(record));
    }
    @PutMapping("/updata")
    public R updata(Usermark record){
        return R.success(usermarkServiceimpl.updateByPrimaryKeySelective(record));
    }

    @DeleteMapping("/delete")
    public R delete(Long id){
        return R.success(usermarkServiceimpl.deleteByPrimaryKey(id));
    }
    @GetMapping("/selectlike")
    public R findlike(String name){
        return R.success(usermarkServiceimpl.findlike(name));
    }

    @PostMapping("/addAll")
    public R addAll(Usermark record){
        return R.success(usermarkServiceimpl.insertSelective(record));
    }


}
